package com.hzcx.app.simplechat.ui.friend.adapter;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hzcx.app.simplechat.R;
import com.hzcx.app.simplechat.ui.friend.bean.FriendBean;
import com.hzcx.app.simplechat.ui.friend.bean.FriendCityBean;
import com.hzcx.app.simplechat.util.empty.EmptyUtils;
import com.hzcx.app.simplechat.util.glide.GlideUtils;

import java.util.List;

public class FriendSearchAdapter extends BaseQuickAdapter<FriendCityBean, BaseViewHolder> {
    public FriendSearchAdapter(@Nullable List<FriendCityBean> data) {
        super(R.layout.rv_item_friend_content, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, FriendCityBean item) {
        helper.setText(R.id.tv_nick_name, EmptyUtils.isNotEmpty(item.getRemarks_name()) ? item.getRemarks_name() : item.getNickname());
        GlideUtils.loadImg(mContext, item.getAvatar(), helper.getView(R.id.iv_head));
        helper.setVisible(R.id.tv_online_state, false);
    }
}
